<template>
  <el-row>
    <el-col>
      <el-button type="primary" @click="selectFiles">选择git仓库</el-button>
    </el-col>
  </el-row>
  <el-row class="mt-2"> 当前路径:{{ filePaths }} </el-row>
</template>

<script setup lang="ts">
// import { ipcRenderer } from 'electron'
import { ref } from 'vue'
const filePaths = ref<string>('')
const selectFiles = () => {
  // 选择文件
  window.electron.ipcRenderer.send('open-dialog')

  // 监听选择文件的结果
  window.electron.ipcRenderer.on('open-dialog-reply', (event, files) => {
    console.log(event, files)
    filePaths.value = files.filePaths[0]
    window.electron.ipcRenderer.send('init-repo', files.filePaths)
  })
}
</script>

<style></style>
